const files = import.meta.globEager('./routes/*')

const routes = Object.values(files)
  .reduce((total, current) => {
    total.push(current.default)
    return total
  }, [])
  .sort((item1, item2) => {
    return item1.meta?.sort || 0 - item2.meta?.sort || 0
  })

export default routes
